import threading
# 创建了一个锁对象lock
lock = threading.Lock()
print(lock)
# 上锁
print(lock.acquire())
# 连续上两次锁会造成死锁
# print(lock.acquire())
# 解锁
print(lock.release())